﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Specialized;
using Extensil.Common.CategoryHandler;

namespace Extensil.Processor.Extensibility
{
    public class CategoryAppSettings
    {
        public static void Load(NameValueCollection cfg)
        {
            if(CategorySection.GetConfig().CategoryHandlers.Count == 0)
                return;
            foreach(PluginHandler pHandler in CategorySection.GetConfig().CategoryHandlers)
            {
                foreach(Extensil.Common.CategoryHandler.AddElement element in pHandler.CategorySettings)
                {
                    if(cfg.Get(element.Key) == null)
                        cfg[element.Key] = element.Value;
                }
            }
        }
    }
}
